
EXEC sp_rename 'XJInspectionPlan.PlaceId', 'CategoryId', 'COLUMN';
GO
ALTER TABLE XJMaintenance ADD CategoryId int
GO
UPDATE XJMaintenance SET CategoryId = 0
GO
ALTER TABLE XJMaintenance ALTER COLUMN CategoryId int not null
GO
ALTER TABLE XJEquipment DROP COLUMN [Version]
GO
ALTER TABLE XJEquipmentStock DROP COLUMN [Version]
GO
ALTER TABLE XJEquipmentStockInDetail DROP COLUMN [Version]
GO
ALTER TABLE XJEquipmentStockOutDetail DROP COLUMN [Version]
GO
ALTER TABLE XJEquipmentStockLog DROP COLUMN [Version]
GO
ALTER TABLE XJMaintenance DROP COLUMN [Version]
GO